Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: XSP.attachEvent() and page unload...
Feedback Type: Question
Product Area: Domino Server
Technical Area: Customization
Platform: Windows XP client
Release: 8.5.1
Reproducible: Not applicable

- I have a link that does a Cancel. This link has an actionGroup that runs server-side script, and loads a page. It works fine as frog hair - the server-side script runs and the data on the XPage are not saved, exactly as needed.
- I would like to be able to run these exact same actions for a page unload. I see in the page source that the Cancel link/button is doing this:

XSP.attachEvent("<internalID>", "<cancelLinkID>", "onclick", null, true, true);

- It seems a possibility would be to add my own attachEvent to "onunload". Then if the link actions are changed, the onunload actions will change as well. In this instance that's desirable.

- But I can't figure out how to acquire <internalID>, which is something relating to Domino's automagic. If I search page source for that ID, it *only* appears here, on this attachEvent(). That seems more than a little strange, given the code I see in the xspClientDojo.js.uncompressed.js file. It appears this parameter is required for proper _processListeners() operation, which is ultimately what "does the work".

- Perhaps I'm barking up the wrong tree? I did look for some sort of unload event, but nothing exists, so I'm thinking attachEvent() or dojo.connect(), are the likely solutions. I looked up the docs for dojo.connect, and attachEvent() uses that internally, but it still appears I'll need this "magic" element ID to bind using that, too.

- I'd appreciate any suggestions. For instance, since this is a page unload, maybe I should simply pass a null here and let it bind globally?

Thanks for your time...

EDIT:

- Passing null for the first parm doesn't work. It doesn't crash, which is a Good Thing! (tm). It goes blank for a second, then reloads the page in edit mode, tossing all changes, except computed values in other custom controls says "Notes Exception: Object has been recycled". Uh oh.


Feedback number DGIE7ZFTFH created by ~Holly Zekhipisonnivu on 01/06/2010

Status: Open
Comments:





Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS